<?php
//mysql_connect("localhost","wanzai_mylibrary","881006");
mysql_connect("127.0.0.1","root","");
mysql_select_db("wanzai_mylibrary");
mysql_query('SET NAMES UTF8');
if($_REQUEST['R_ID']!=null){
$sql=mysql_query("SELECT * FROM student s, review r WHERE r.S_Num = s.S_Num and r.R_ID='".$_REQUEST['R_ID']."'");
}else if($_REQUEST['F_Num']!=null){
$sql=mysql_query("INSERT INTO friendship (S_Num,F_Num) VALUES(".$_REQUEST['S_Num'].",".$_REQUEST['F_Num'].")");
}else if($_REQUEST['ISBN']!=null){
$sql=mysql_query("SELECT * FROM review WHERE ISBN='".$_REQUEST['ISBN']."'");
}
	while($e=mysql_fetch_assoc($sql))
			$output[]=$e;
print(json_encode($output));
mysql_close();
?>

